﻿<Page x:Class="SnappedWindowDemo.Views.ExampleView"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      DataContext="{Binding Source={StaticResource ViewModelLocator}, Path=ExampleViewModel}"
      KeepAlive="True"   
      mc:Ignorable="d" 
      d:DesignHeight="300" d:DesignWidth="300"
	Title="ExampleView">

    <Grid Margin="32">

        <Grid.RowDefinitions>
            <RowDefinition Height="20"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="20"/>
            <RowDefinition Height="20"/>
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="20"/>
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="20"/>
        </Grid.ColumnDefinitions>

        <Button Content="Dock to top"
                Command="{Binding DockToTopCommand}"
                Grid.Column="1"/>

        <Button Content="Dock to bottom"
                Command="{Binding DockToBottomCommand}"
                Grid.Row="2"
                Grid.Column="1"/>

        <Button Grid.Row="1"
                Command="{Binding DockToLeftCommand}">
            <Button.Content>
                <TextBlock Text="Dock to left">
                    <TextBlock.LayoutTransform>
                        <RotateTransform Angle="-90"></RotateTransform>
                    </TextBlock.LayoutTransform>
                </TextBlock>
            </Button.Content>
        </Button>

        <Button Grid.Row="1" Grid.Column="2"
            Command="{Binding DockToRightCommand}" Margin="0,6,0,14" Grid.RowSpan="2">
            <Button.Content>
                <TextBlock Text="Dock to right">
                    <TextBlock.LayoutTransform>
                        <RotateTransform Angle="90"></RotateTransform>
                    </TextBlock.LayoutTransform>
                </TextBlock>
            </Button.Content>
        </Button>

        <StackPanel Grid.Row="1" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Center">
            
            <TextBlock Text="PinStyle" Style="{StaticResource WinTextTitle1Style}" Margin="{StaticResource WinMargin}"/>
            
            <RadioButton Content="Always On" 
                         Style="{StaticResource WinRadioButtonStyle}"
                         IsChecked="{Binding PinStyle, Mode=TwoWay, Converter={StaticResource EnumToRadioButtonConverter}, ConverterParameter=AlwaysOn}"/>

            <RadioButton Content="Always Off" 
                         Style="{StaticResource WinRadioButtonStyle}"
                         IsChecked="{Binding PinStyle, Mode=TwoWay, Converter={StaticResource EnumToRadioButtonConverter}, ConverterParameter=AlwaysOff}"/>

            <RadioButton Content="Touch friendly" 
                         Style="{StaticResource WinRadioButtonStyle}"
                         IsChecked="{Binding PinStyle, Mode=TwoWay, Converter={StaticResource EnumToRadioButtonConverter}, ConverterParameter=TouchFriendly}"/>

            <RadioButton Content="Fixed" 
                         Style="{StaticResource WinRadioButtonStyle}"
                         IsChecked="{Binding PinStyle, Mode=TwoWay, Converter={StaticResource EnumToRadioButtonConverter}, ConverterParameter=Fixed}"/>
        </StackPanel>        
        
        <TextBlock Grid.Column="1" Grid.Row="3" Text="STRG can be used as the magic key for mode AlwaysOn"
                   Visibility="{Binding PinStyleAlwaysOn, Converter={StaticResource BooleanToVisibilityConverter}}"
                   Style="{StaticResource WinTextAccentStyle}"/>
    </Grid>
</Page>
